package com.cn.wanxi.thread;

public class MyRedisThread {
    static final String aa = "aa";

    public static void main(String[] args) {
        final int[] j = {0};
        for (int i = 0; i < 1000; i++) {
            Thread thread = new Thread(new Runnable() {

                @Override
                public void run() {
                    synchronized (aa) {
                        System.out.println(j[0]);
                        j[0]++;
                    }
                }
            });
            thread.start();
        }
    }
}
